
<div id="main">
  <div class="cl">&nbsp;</div>

  <!-- Content -->
  <div id="content">

    <!-- Box -->
    <div class="box">
      <!-- Box Head -->
      <div class="box-head">
        <h2 class="left">文章分类</h2>
        <div class="right">
          <input type="text" class="field small-field" />
          <input type="submit" class="button" value="search" />
        </div>
      </div>
      <!-- End Box Head -->

      <!-- Table -->
      <div class="table">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tbody>
            <tr>
              <th>名称</th>
              <th>描述</th>
              <th>Date</th>
              <th>文章数</th>
              <th width="110" class="ac">删除 编辑</th>
            </tr>
          </tbody>

          <% @categories.each do |category| %>
            <tbody class="<%= cycle("even", "odd") -%>">
              <tr>
                <td><h3><%= category.name %></h3></td>
                <td><%= category.description %></td>
                <td title="发表于：<%= category.created_at.to_s(:db) -%>"><%= category.created_at.strftime('%Y-%m-%d') -%></td>
                <td><%= category.count %></td>
                <td><a href="#" class="ico del">Delete</a><a href="#" class="ico edit">Edit</a></td>
              </tr>
            </tbody>
          <% end %>

        </table>

        <!-- Pagging -->
        <div class="pagging">
          <div class="left"><%= page_entries_info @categories %></div>
          <div class="right">
            <%= will_paginate @categories, :container => false, :inner_window => 1, :outer_window => 1, :previous_label => 'Previous', :next_label => 'Next' %>

          </div>
        </div>
        <!-- End Pagging -->

      </div>
      <!-- Table -->

    </div>
    <!-- End Box -->

  </div>
  <!-- End Content -->


  <!-- Sidebar -->
  <div id="sidebar">

    <!-- Box -->
    <div class="box">

      <!-- Box Head -->
      <div class="box-head">
        <h2>选项</h2>
      </div>
      <!-- End Box Head-->

      <div class="box-content">
        <a href="#" class="add-button"><span>增加分类</span></a>
        <div class="cl">&nbsp;</div>
      </div>

      <%= form_for [:admin, @category], :url => create_category_admin_articles_path do |f| %>
        <!-- Form -->
        <div class="form">
          <p>
            <span class="req">10个字</span>
            <label>分类名称 <span>(必填)</span></label>
            <%= f.text_field :name, :size => 20, :class => "field" %>
          </p>

          <p>
            <span class="req">10个字</span>
            <label>分类别名 <span>(必填)</span></label>
            <%= f.text_field :alias, :size => 20, :class => "field" %>
          </p>

          <p>
            <span class="req">200个字</span>
            <label>分类描述</label>
            <%= f.text_area :description, :class => "field", :rows=>"10", :cols=>"20" %>
          </p>
        </div>
        <!-- End Form -->

        <!-- Form Buttons -->
        <div class="buttons">
          <%= submit_tag '提交保存', :disable_with => "正在提交...", :class=>"button" %>
        </div>
        <!-- End Form Buttons -->
      <% end %>

    </div>
    <!-- End Box -->

  </div>
  <!-- End Sidebar -->

  <div class="cl">&nbsp;</div>
</div>